import 'package:flutter/material.dart';
import 'package:photoxia/compant/Appcolor.dart';
import 'package:photoxia/compant/Photos.dart';
import 'package:photoxia/compant/TopUserItem.dart';
import 'package:photoxia/compant/TrendingItem.dart';
import 'package:photoxia/screen/home.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        scrolledUnderElevation: 0,
        elevation: 0,
        leading: Container(),
        actions: [
          Image.asset('assets/icon17.png'),
          Padding(padding: EdgeInsets.all(30)),
        ],
      ),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 30),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                'Explore',
                style: TextStyle(
                    color: textColor3,
                    fontSize: 27,
                    fontWeight: FontWeight.w600),
              ),
              Row(
                children: [
                  Text(
                    'Top image today',
                    style: TextStyle(
                        color: textColor2,
                        fontSize: 17,
                        fontWeight: FontWeight.w400),
                  ),
                  const SizedBox(
                    width: 20,
                  ),
                  Text(
                    '1st june, 18',
                    style: TextStyle(
                        color: textColor2,
                        fontSize: 9,
                        fontWeight: FontWeight.w400),
                  ),
                ],
              ),
              SingleChildScrollView(
                padding: EdgeInsets.all(0),
                scrollDirection: Axis.horizontal,
                child: Row(
                  children: [
                    Image.asset('assets/image1.png'),
                    Image.asset('assets/image2.png'),
                  ],
                ),
              ),
              Text(
                'Top image today',
                style: TextStyle(
                    color: textColor2,
                    fontSize: 17,
                    fontWeight: FontWeight.w400),
              ),
              const SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: Row(
                  children: [
                    TrendingItem(
                      bc1: Color(0xffFFBCA6),
                      bc2: Color(0xffFF876B),
                      img: 'assets/Trending1.png',
                      text: 'Sunset',
                      tip: '405403 photos',
                    ),
                    TrendingItem(
                      bc1: Color(0xffACFAFF),
                      bc2: Color(0xff669FFF),
                      img: 'assets/Trending2.png',
                      text: 'Beauty',
                      tip: '64113 photos',
                    ),
                    TrendingItem(
                      bc1: Color(0xffFF92CB),
                      bc2: Color(0xffA06CFC),
                      img: 'assets/Trending3.png',
                      text: 'Mountain',
                      tip: '84211 photos',
                    ),
                  ],
                ),
              ),
              homeTitle(
                text: 'Photos from your interest',
                tip: 'See All',
              ),
              const Photos(),
              const Row(
                children: [
                  Expanded(
                    flex: 2,
                    child: Photos(),
                  ),
                  SizedBox(
                    width: 20,
                  ),
                  Expanded(
                    flex: 1,
                    child: Photos(),
                  ),
                ],
              ),
              const Row(
                children: [
                  Expanded(
                    flex: 1,
                    child: Photos(),
                  ),
                  SizedBox(
                    width: 20,
                  ),
                  Expanded(
                    flex: 2,
                    child: Photos(),
                  ),
                ],
              ),
              Center(
                child: Container(
                  width: 100,
                  padding: const EdgeInsets.all(10),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      gradient: const LinearGradient(colors: [
                        Color(0xffFFBCA6),
                        Color(0xffFF876B),
                      ], begin: Alignment.topLeft, end: Alignment.bottomRight),
                      boxShadow: [
                        BoxShadow(
                            color: const Color(0xffFF876B).withOpacity(0.2),
                            offset: const Offset(0, 13),
                            blurRadius: 27)
                      ]),
                  height: 30,
                  child: const Center(
                    child: Text(
                      'Load More',
                      style: TextStyle(color: Colors.white, fontSize: 8),
                    ),
                  ),
                ),
              ),
              homeTitle(text: 'Top Users', tip: "See All"),
              const SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    TopUserItem(
                      img: 'assets/TopUsers1.png',
                      text: 'Jeffrey Campbell',
                      tip: 'Dhaka',
                      count1: '85',
                      count2: '1356',
                    ),
                    TopUserItem(
                      img: 'assets/TopUsers2.png',
                      text: 'John Jenkins',
                      tip: 'Tokiyo',
                      count1: '471',
                      count2: '195',
                    ),
                    TopUserItem(
                      img: 'assets/TopUsers3.png',
                      text: 'Charles Burton',
                      tip: 'New York',
                      count1: '657',
                      count2: '42183',
                    ),
                  ],
                ),
              ),
              SizedBox(
                height: 100,
              )
            ],
          ),
        ),
      ),
    );
  }
}
